package com.swak.frame.exception;

import com.swak.frame.enums.BasicErrCode;
import com.swak.frame.enums.IResultCode;
import com.swak.frame.exception.core.BaseException;

/**
 *  参数异常
 * @author colley.ma
 * @date 2022/9/20 14:21
 */
public class ArgumentException extends BaseException {

    public ArgumentException(Throwable cause) {
        super(cause);
        this.setErrCode(BasicErrCode.INVALID_PARAMETER);
    }

    public ArgumentException(String errMessage) {
        super(errMessage);
        this.setErrCode(BasicErrCode.INVALID_PARAMETER);
    }

    public ArgumentException(String errMessage, Throwable e) {
        super(errMessage, e);
        this.setErrCode(BasicErrCode.INVALID_PARAMETER);
    }

    public ArgumentException(IResultCode errCode, String errMessage) {
        super(errMessage);
        this.setErrCode(errCode);
    }
    public ArgumentException(IResultCode errCode) {
        super(errCode.getMsg());
        this.setErrCode(errCode);
    }

    public ArgumentException(Integer errCode, String errMessage) {
        super(errCode, errMessage);
    }
}
